package day12;

import java.util.Scanner;

public class Test {

    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        User user = new User();
        System.out.print("请输入用户名:");
        user.setUsername(input.next());
        System.out.print("请输入密码:");
        user.setPassword(input.next());
        UserService userService = new UserService();
        try {
            userService.login(user);
            System.out.println("登录成功!");
        } catch (UsernameNotExistException e) {
            System.out.println("用户名不存在！");
        } catch (PasswordMismatchException e) {
            System.out.println("密码错误！");
        }


    }
}
